package cn.getech.data.development.mapper.permission;


import cn.getech.data.development.entity.permission.SysRoleDataPermission;
import cn.getech.data.development.entity.permission.SysRoleDataPermissionExample;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface SysRoleDataPermissionMapper extends BaseMapper<SysRoleDataPermission> {

    int deleteByExample(SysRoleDataPermissionExample example);

    int insertOrUpdateSelective(SysRoleDataPermission record);

    List<SysRoleDataPermission> selectByExample(SysRoleDataPermissionExample example);

    int updateBatch(List<SysRoleDataPermission> list);

    int batchInsert(@Param("list") List<SysRoleDataPermission> list);

    List<Long> queryUserRole(@Param("userId") Integer userId);

    Integer queryAdmin(@Param("userId") Integer userId,@Param("tenantId") Integer tenantId);

    List<Map> queryRoleByDataIds(@Param("dataIds") List<Integer> ids);

    Long selectRoleByName(@Param("roleName") String roleName);

    List<Map> queryRealRoleByDataIds(@Param("dataIds") List<Integer> ids);

    SysRoleDataPermission selectByRoleId(@Param("dataType") Integer dataType,@Param("dataId") Integer dataId,@Param("roleId") Long roleId);
}